<?php
/**
 * @file
 * class Event sets up events
 * 
 * Copyright 2011 by UNHM CIS605 project Donate team.
 * This program is part of BBBS and YWCA Donation management system.
 * Donate is free software. It comes with absolutely no warranty.
 * You can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 * 
 * @version April 14th 2011
 * @author Laura Cassella, Chris Reekie
 */

/**
 * Represents event data stored in the dbEvent table.
 */

class Event {
	private $eventID; 		// id (unique key) PK = auto-increment
	private $eventTypeID; 	// event Type ID = FK from eventType table
	private $eventDate;  	// event date as date - format: 2010-11-15
	private $street; 	 	// street - string
	private $city; 		 	// city - string
	private $stateName; 	 	// state - string
	private $zip; 		 	// zip code - string
		
	/**
	 * Constructor for Event class.
	 */
	
	function __construct( $ev, $ed, $s, $c, $st, $z) {
		$this->eventID = null;
		$this->eventTypeID = $ev;
		$this->eventDate = $ed;
		$this->street = $s;
		$this->city = $c;
		$this->stateName = $st;
		$this->zip = $z;	
	}
	
	/**
	 * Getters for the Event class.
	 */
	
	/**
	 * @return int eventID auto-generated by the database.  
	 */
	function getEventID(){
		return $this->eventID;
	}
	
	/**
	 * @return int eventTypeID auto-generated foreign key. 
	 */
    function getEventTypeID(){
		return $this->eventTypeID;
	}
	
	/**
	 * @return date eventDate. 
	 */
    function getEventDate(){
		return $this->eventDate;
	}
	
	/**
	 * @return string street. 
	 */
    function getStreet(){
		return $this->street;
	}
	
	/**
	 * @return string city.  
	 */
    function getCity(){
		return $this->city;
	}
	
	/**
	 * @return string state. 
	 */
    function getStateName(){
		return $this->stateName;
	}
	
	/**
	 * @return string zipcode.  
	 */
    function getZip(){
		return $this->zip;
	}
	
	/**
	 * Setters for the Event class
	 * EventID and eventTypeID cannot be changed.
	 * These fields are auto-generated unique keys.
	 */
	
	/**
	 * @param date $ed.
	 */ 
	function set_eventDate($ed) {
		$this->eventDate = $ed;
	}
	
	/**
	 * @param string $s.
	 */ 
	function set_street($s) {
		$this->street = $s;
	}
	
	/**
	 * @param string $c.
	 */ 
	function set_city($c) {
		$this->city = $c;
	}
	
	/**
	 * @param string $st.
	 */ 
	function set_state($st) {
		$this->state = $st;
	}
	
	/**
	 * @param string $z.
	 */ 
	function set_zip($z) {
		$this->zip = $z;
	}
	
function printAllAttributes()
  {
    $output = sprintf("eventTypeID: %d, eventDate: %s, street: %s, city: %s, stateName: %s, zip: %s.", 
            $this->eventTypeID,$this->eventDate, $this->street, $this->city, $this->stateName, $this->zip);
    return $output;
  }
	
}
?>
	